<template>
  <div class="root bg-white"><cate v-for="item in data" :key="item" :text="item.text" :bgImg="item.bgImg" :type="item.type"/>
  </div>
</template>
<script>
import {get} from '@/util'
import cate from '@/components/weapon/Cate'
export default {
  data () {
    return {
      data: [
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_hslw_06.png',
          text: '大剑',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_hslw_09.png',
          text: '太刀',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_tmsw_11.png',
          text: '大锤',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_mn_14.png',
          text: '双刀',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_lslw_08.png',
          text: '轻弩',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_hslw_08.png',
          text: '重弩',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_hslw_06.png',
          text: '斩击斧',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_unem006_g.png',
          text: '弓',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_hl_12.png',
          text: '长枪',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_mn_13.png',
          text: '铳枪',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_kl_07.png',
          text: '片手剑',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_unem001_f.png',
          text: '狩猎笛',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_kl_07.png',
          text: '操虫棍',
          type: '1'
        },
        {
          bgImg: 'http://gamer.qq.com/images/weaponicon/ep_unem001_f.png',
          text: '盾斧',
          type: '1'
        }
      ]
    }
  },
  components: {
    cate
  },
  methods: {
    async getData () {
      wx.showNavigationBarLoading()
      const infoData = await get('/weapp/wlist')
      this.dataList = infoData
      wx.hideNavigationBarLoading()
    }
  },
  mounted () {
    this.getData()
  }
}
</script>
<style>
.loop {
  display: inline-block;
}
.bg-white{
  background-color: #ffffff;
}
</style>
